﻿@page "/gateway/plugin"
@attribute [Authorize]
@attribute [RolePermission]

@namespace ThingsGateway.Gateway.Razor
@using BootstrapBlazor.Components
@using ThingsGateway.Admin.Application
@using ThingsGateway.Admin.Razor
@using ThingsGateway.Gateway.Application
@inherits ComponentDefault


<div style="height: var(--table-height);padding: 2px 5px 10px 5px;">
    <AdminTable @ref=table TItem="PluginOutput" AutoGenerateColumns="true" ShowDefaultButtons=false
                AllowResizing="true" IsFixedHeader=true IsMultipleSelect=false
                ShowExtendEditButton=false ShowExtendDeleteButton=false ShowExtendButtons=false
                ShowExportButton="true" ShowAdvancedSearch=false SearchModel=SearchModel
                OnQueryAsync="OnQueryAsync">

        <TableToolbarTemplate>
            <TableToolbarButton TItem="PluginOutput" Color="Color.Info" Icon="fa fa-plus" Text="@DefaultLocalizer["Add"]"
                                OnClickCallback="OnAdd" IsShow=@(AuthorizeButton("添加")) />
        </TableToolbarTemplate>

        <ExportButtonDropdownTemplate Context="ExportContext">
            <div class="dropdown-item" @onclick="() => ExcelExportAsync(ExportContext)" IsDisabled=@(!AuthorizeButton("导出"))>
                <i class="fas fa-file-export"></i>
                <span>@DefaultLocalizer["TablesExportButtonExcelText"]</span>
            </div>
        </ExportButtonDropdownTemplate>
    </AdminTable>
</div>
@code {
    AdminTable<PluginOutput> table;
}
